{% extends "base.html" %}

{% block title %}Remitos{% endblock %}
{% block head %}Listado de remitos{% endblock %}

{% block content %}
<div id="o5">
    <p>| <a href="/remitos/agregar/">Agregar remito</a> | <a href="javascript:o('o2'); javascript:o('o5'); window.print();">Imprimir</a> |</p>
    <form method="POST" action="." name="form">{% csrf_token %}
    <table align="center" border="0">
        <tr><td><b>Buscar remitos (por item)</b></td></tr>
        <tr><td>{{ form.text }} <input type="submit" value="Buscar"/></td></tr>
        <tr>
            <td><a href="/remitos/listado/">Mostrar todos</a></td>
        </tr>
    </table>
    </form>
    <br />
</div>
    <table class="tablesorter" align="center" id="sorter_clientes" border="0" cellpadding="0" cellspacing="1" style="width:970px;">
        <thead>
            <tr>
                <th>Remito</th>
                <th>Fecha</th>
                <th>Cliente</th>
                {% if perms.gestion.change_remitos %}
                    <th colspan="2"></th>
                {% else %}
                    <th></th>
                {% endif %}
            </tr>
        </thead>
        <tbody>
            {% for obj in todo %}
                <tr>
                    <td style="width:15px;font-weight:bold;">{{ obj.numeroRemito }}</td>
                    <td style="width:40px;">{{ obj.fecha|date:"SHORT_DATE_FORMAT"|default_if_none:"" }}</td>
                    <td>{{ obj.cliente|default_if_none:"" }}</td>
                    <td class="right"><a href="/remitos/listado/items/{{ obj.id|cut:"." }}/">Ver</a></td>
                    {% if perms.gestion.change_remitos %}
                        <td class="right"><a href="/remitos/editar/{{ obj.id|cut:"." }}/">Editar</a></td>
                    {% endif %}
                </tr>
            {% endfor %}
        </tbody>
    </table>
    <br /><br />
    <p>| <a href="/remitos/agregar/">Agregar remito</a> |</p>
    <br /><br /><br /><br /><br /><br />
{% endblock %}
